#include <stdio.h>

unsigned a[101] = {0};

int main()
{
    unsigned cnt = 0;
    do
    {
        ++cnt;
        scanf("%u", a + cnt);
    } while (a[cnt]);
    for (unsigned *x = a + cnt - 1; x > a; --x)
    {
        printf("%u ", *x);
    }
    return 0;
}